<extend name="Public/baseConf"/>
<block name="style">
</block>
<block name="breadcrumb"> 
	<div class="row wrapper border-bottom white-bg page-heading">
	    <div class="col-lg-4">
	        <h2>分类管理</h2>
	        <ol class="breadcrumb">
	            <li><a href="{:U('index/index')}">首页</a></li>
	            <li class="active">
	                <strong>分类管理</strong>
	            </li>
	        </ol>
	    </div>
	    <div class="col-lg-6"></div>
	    <div class="col-lg-2">
            <div class="title-action">
 					<a class="btn btn-primary" href="{:U('add')}">
						<i class="fa fa-pencil align-top"></i>新增
					</a>
            </div>
        </div>
	</div> 
</block>
<block name="body">
<div class="row">
    <div class="col-lg-12">
		<div class="table-responsive">
			<table class="table table-striped table-bordered table-hover dataTables-example">
	         	<thead>
		             <tr>
						<!-- <th>折叠</th> -->
						<th>排序</th>
						<th>发布</th>
						<th>名称</th>
						<th>所在层级</th>
						<th>操作</th>
		             </tr>
	            </thead>
	            <tbody>
	            	{:R('Category/tree', array($tree))}
	          	</tbody>
	        </table>
		</div> 
	</div> 
</div>
</block>

<block name="script">
	<script type="text/javascript">
		(function($){
			/* 分类展开收起 */
	        $(".haschild").find(".tdchild i").addClass("fa fa-minus")
	            .click(function(){
	                var self = $(this);
	                if(self.hasClass("fa fa-minus")){
	                    self.closest("tr").next().slideUp("fast", function(){
	                        self.removeClass("fa fa-minus").addClass("fa fa-plus");
	                    });
	                } else {
	                    self.closest("tr").next().slideDown("fast", function(){
	                        self.removeClass("fa fa-plus").addClass("fa fa-minus");
	                    });
	                }
	            });
		})(jQuery);
	</script>
</block>
